﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace zjbks
{
    public partial class TianXieZhiYuan : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Model.SuccessInfoEntity success = new Model.SuccessInfoEntity();
            success.Collage1 = DropDownList1.SelectedValue;
            success.Collage2 = DropDownList2.SelectedValue;
            success.Collage3 = DropDownList3.SelectedValue;
            success.Collage4 = DropDownList4.SelectedValue;
            success.Collage5 = DropDownList5.SelectedValue;
            success.ID = Session["id"].ToString();
            BLL.BSuccessInfo bSuccess = new BLL.BSuccessInfo();
            Model.SuccessInfoEntity su =new Model.SuccessInfoEntity();
            su = bSuccess.GetSuccessInfo(success.ID);
            if(su==null)
            {
                if(bSuccess.AddSuccessInfo(success)>0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('填报成功！');</script>");
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('填报失败！');</script>");
            }
        }
    }
}